using System;
using System.Collections;
namespace AppToolKit.Business.Batch
{
	public class BatchProcessExecuteor
	{
		private ArrayList parpreList_;
		private IBatchProcessor processor_;
		private object context_;
		public BatchProcessExecuteor(ArrayList parpreList, object context, IBatchProcessor processor)
		{
			this.parpreList_ = parpreList;
			this.processor_ = processor;
			this.context_ = context;
		}
		public void Excute(ProcessPrompt prompt)
		{
			foreach (object current in this.parpreList_)
			{
				ProcessResult processResult = this.processor_.OnProcess(current, this.context_);
				if (prompt != null)
				{
					prompt(this, processResult);
				}
				if (processResult.Code == ProcessResultCode.IfFaileReturn)
				{
					break;
				}
			}
		}
	}
}
